<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    .box {
      width: 600px;
      height: 600px;
      background-color: pink;
      /* 
      grid布局是一种网格布局
      */
      display: grid;
      grid-template-columns: repeat(3, 100px);
      grid-template-rows: repeat(3, 100px);
    }

    .item {
      background-color: skyblue;
      border: 1px solid aqua;
    }

    /* 相当于定位 从左(边)到右 从上(边)往下
    
    grid-column-start: 左边框所在的垂直网格线;
    grid-column-end: 右边框所在的垂直网格线;
    grid-row-start: 上边框所在的水平网格线;
    grid-row-end: 下边框所在的水平网格线;
    如果有重叠 z-index调整显示层级
    */
    .item:nth-child(3) {
      grid-column-start: 3;
      grid-column-end: 4;
      grid-row-start: 3;
      grid-row-end: 4;
      z-index: 20;
    }

    .item:nth-child(4) {
      background-color: blue;
      grid-column-start: 3;
      grid-column-end: 4;
      grid-row-start: 3;
      grid-row-end: 4;
    }
  </style>
</head>

<body>
  <div class="box">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
    <div class="item">5</div>
    <div class="item">6</div>
    <div class="item">7</div>
    <div class="item">8</div>
    <div class="item">9</div>
  </div>
</body>

</html>